﻿using System;

namespace class_demo
{
    public class Animal {
        public string name;
        public Boolean isVolant;
    }
    class Program
    {
        public void Dog() {
            Animal animal = new Animal();
            animal.name = "dog";
            animal.isVolant = false;
            Console.WriteLine("Name is " + animal.name);
            if (animal.isVolant)
            {
                Console.WriteLine("It can fly.\n");
            }
            else {
                Console.WriteLine("It can not fly.\n");
            }
        }

        public void Bird() {
            Animal animal = new Animal();
            animal.name = "bird";
            animal.isVolant = true;
            Console.WriteLine("Name is " + animal.name);
            if (animal.isVolant)
            {
                Console.WriteLine("It can fly.\n");
            }
            else
            {
                Console.WriteLine("It can not fly.\n");
            }
        }

        static void Main(string[] args)
        {
            Program program = new Program();
            Console.WriteLine("Please enter your favorite animal between dog and bird?");
            string favorite_animal = Console.ReadLine();
            switch (favorite_animal)
            {
                case "dog":
                    program.Dog();
                    break;
                case "bird":
                    program.Bird();
                    break;
                default:
                    Console.WriteLine("Input error!");
                    break;
            }
            Console.ReadKey();
        }
    }
}
